<form id="pagerForm" action="admin.php?mod=user_role&action=index" onsubmit="return dwzSearch(this, 'dialog');">
	<input type="hidden" name="pageNum" value="{$pageNum}" />
	<input type="hidden" name="numPerPage" value="{$numPerPage}" />
	<input type="hidden" name="orderField" value="id" />
	<input type="hidden" name="orderDirection" value="id" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" method="post" action="admin.php?mod=user_role&action=index" onsubmit="return dwzSearch(this, 'dialog');">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>{lang user_role_name}</label>
				<input class="" name="role_name_keyword" value="{$role_name_keyword}" type="text">
			</li>	   
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">{lang search}</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
    	<div class="panelBar">
		<ul class="toolBar">
            <li><a class="add" href="admin.php?mod=user_role&action=add" target="dialog" rel="admin_user_role_add" mask="true"><span>{lang add}</span></a></li>
			<li><a class="delete" href="admin.php?mod=user_role&action=delete&role_id={{role_id}}" target="dialogajaxTodo" title="确定要删除吗?"><span>{lang delete}</span></a></li>
			<li><a class="edit" href="admin.php?mod=user_role&action=edit&role_id={{role_id}}" target="dialog" rel="admin_user_role_edit" mask="true"><span>{lang edit}</span></a></li>
		</ul>
	</div>
	<table class="table" layoutH="138" targetType="dialog" width="100%">
		<thead>
			<tr>
                <th width="30">{lang operate}</th>
                <th orderfield="info_cateid" width="60">{lang user_role_id}</th>
                <th>{lang user_role_name}</th>
			</tr>
		</thead>
		<tbody>
            <!--{loop $page_array $pkey $pvalue}-->
			<tr target="role_id" rel="{$pvalue[role_id]}">
                <td><input type="checkbox" name="check_info" value="{$pvalue[role_id]}" onclick="selectOne(this)"></td>
                <td>{$pvalue[role_id]}</td>
                <td>{$pvalue[role_name]}</td>
			</tr>
            <!--{/loop}-->
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>{lang perpage}</span>
			<select name="numPerPage" onchange="dwzPageBreak({targetType:'dialog', data:{numPerPage:this.value}})">
                <option <!--{if $numPerPage==10}--> selected<!--{/if}--> value="10">10</option>
                <option <!--{if $numPerPage==20}--> selected<!--{/if}--> value="20">20</option>
                <option <!--{if $numPerPage==50}--> selected<!--{/if}--> value="50">50</option>
                <option <!--{if $numPerPage==100}--> selected<!--{/if}--> value="100">100</option>
			</select>
			<span>  {lang total}{$pagetotal}</span>
		</div>
		<div class="pagination" targetType="dialog" totalCount="{$pagetotal}" numPerPage="{$numPerPage}" pageNumShown="5" currentPage="{$pageNum}"></div>
	</div>
</div>
<script type="text/javascript">
function selectOne(obj){
    var objCheckBox = document.getElementsByName("check_info");
    for(var i=0; i < objCheckBox.length; i++){
        //判断复选框集合中的i元素是否为obj，若为否则便是未被选中
        if (objCheckBox[i]!=obj) {
            objCheckBox[i].checked = false;
        } else{
            //若是，原先为被勾选的变成勾选，反之则变成未勾选
            //objCheckBox[i].checked = obj.checked;
            //或者使用下句，亦可达到同样效果
            objCheckBox[i].checked = true;
        }
    }
}
</script>